<?php 
date_default_timezone_set('America/New_York');

$con = mysql_connect("localhost","showandt_tphbm","gohbm");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("showandt_HBM", $con);


$result2 = mysql_query("DELETE FROM tbl_emails WHERE date < DATE_SUB(NOW(), INTERVAL 7 DAYS)");

//echo $result2;
  echo "<br />";

$result = mysql_query("SELECT * FROM tbl_emails");
while($row = mysql_fetch_array($result2))
  {
  echo $row['date'];
  echo "<br />";
  }


/* grab emails */
$yesterday = date("Y-m-d", strtotime ("-1 hours"));
$searchQuery = 'SINCE "'.$yesterday.'"';

echo $searchQuery;

mysql_close($con);


?>
